﻿<?xml version="1.0" encoding="utf-8" ?> 
<Mapping xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
	<Entity type="ValueTypes" table="Entity" discriminator="Type" discriminator-value="ValueTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="decimal" table="Attribute" field="Value" type="System.Decimal" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="decimal" />
		<Attribute name="uint" table="Attribute" field="Value" type="System.UInt32" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="uint" />
		<Attribute name="byte" table="Attribute" field="Value" type="System.Byte" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="byte" />
		<Attribute name="ulong" table="Attribute" field="Value" type="System.UInt64" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="ulong" />
		<Attribute name="string" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="string" />
		<Attribute name="int" table="Attribute" field="Value" type="System.Int32" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="int" />
		<Attribute name="ushort" table="Attribute" field="Value" type="System.UInt16" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="ushort" />
		<Attribute name="bool" table="Attribute" field="Value" type="System.Boolean" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="bool" />
		<Attribute name="double" table="Attribute" field="Value" type="System.Double" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="double" />
		<Attribute name="sbyte" table="Attribute" field="Value" type="System.SByte" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="sbyte" />
		<Attribute name="long" table="Attribute" field="Value" type="System.Int64" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="long" />
		<Attribute name="short" table="Attribute" field="Value" type="System.Int16" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="short" />
		<Attribute name="float" table="Attribute" field="Value" type="System.Single" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="float" />
		<Attribute name="char" table="Attribute" field="Value" type="System.Char" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="char" />
		<Attribute name="object" table="Attribute" field="Value" type="System.Byte[]" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="object" />
		<Attribute name="object2" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="object2" />
	</Entity>
	
	<Entity type="Person" table="Entity" discriminator="Type" discriminator-value="Person">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Age" table="Attribute" field="Value" type="System.Int32" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Age" />
		<Attribute name="Lastname" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Lastname" />
		<Attribute name="Firstname" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Firstname" />
		<Attribute name="Acceleration" table="Attribute" field="Value" type="System.Decimal" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Acceleration" />
			
		<Reference name="Prout" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
		
		<Reference name="Brother" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
		
		<Reference name="Partners" entityChild="Person" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
		
		<Reference name="Friends" entityChild="Thing" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
		
		<Reference name="MyCompany" entityChild="Company" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Thing" table="Entity" discriminator="Type" discriminator-value="Thing">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Lastname" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Lastname" />
		<Attribute name="Firstname" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Firstname" />
	</Entity>
	
	<Entity type="FlaggedCategory" table="Entity" discriminator="Type" discriminator-value="FlaggedCategory">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="FlaggedCategory" table="Attribute" field="Value" type="TestUSS.Common+FlaggedCategory,NUnit" db-type="AnsiString" 
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="FlaggedCategory" />
	</Entity>
	
	<Entity type="Category" table="Entity" discriminator="Type" discriminator-value="Category">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Category" table="Attribute" field="Value" type="TestUSS.Common+Category,NUnit" db-type="AnsiString" 
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Category" />
	</Entity>
	
	<Entity type="ComplexTypes" table="Entity" discriminator="Type" discriminator-value="ComplexTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="array2" table="Attribute" field="Value" type="System.Int32[]" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="array2" />
		<Attribute name="array1" table="Attribute" field="Value" type="System.String[]" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="array1" />
		<Attribute name="datetime" table="Attribute" field="Value" type="System.DateTime" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="datetime" />
		<Attribute name="timespan" table="Attribute" field="Value" type="System.TimeSpan" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="timespan" />
	</Entity>
	
	<Entity type="SerializableTypes" table="Entity" discriminator="Type" discriminator-value="SerializableTypes">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="StringCollection" table="Attribute" field="Value" type="System.Collections.Specialized.StringCollection,System"
			db-type="AnsiString" size="1024" parentField="FK_Entity" discriminator="Name"
			discriminator-value="StringCollection" />
	</Entity>
	
	<Entity type="Manager" table="Entity" discriminator="Type" discriminator-value="Manager">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Reference name="MyCompany" entityChild="Company" discriminator="Role">
			<Rule parentField="Id" childTable="Reference" childField="FK_Parent" />
			<Rule parentField="FK_Child" childTable="Entity" childField="Id" />
		</Reference>
	</Entity>
	
	<Entity type="Company" table="Entity" discriminator="Type" discriminator-value="Company">
		<Id field="Id" ><Generator name="guid" /></Id>
		<Attribute name="Name" table="Attribute" field="Value" type="System.String" db-type="AnsiString"
			size="1024" parentField="FK_Entity" discriminator="Name" discriminator-value="Name" />
		
	</Entity>
</Mapping>